package com.vogue.flowmeter.api.event;


import java.io.Serializable;

/**
 *
 * 定义事件====下载进度
 *
 * 所有能被实例化为 Object 的实例都可以作为事件
 * eventbus 3中如果用到了索引加速，事件类的修饰符必须为 public
 */
public class DownloadMessageEvent implements Serializable {
    private String control;
    private String message;
    private boolean isApk;
    public long totalSize = 0;
    public long downloadedSize = 0;
    private int progress;
    //为true是完成下载或者取消下载
    public boolean status;

    public DownloadMessageEvent() {
    }

    public DownloadMessageEvent(String control, String message, boolean isApk, long totalSize, long downloadedSize, int progress, boolean status) {
        this.control = control;
        this.message = message;
        this.isApk = isApk;
        this.totalSize = totalSize;
        this.downloadedSize = downloadedSize;
        this.progress = progress;
        this.status = status;
    }

    public String getControl() {
        return control;
    }

    public void setControl(String control) {
        this.control = control;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isApk() {
        return isApk;
    }

    public void setApk(boolean apk) {
        isApk = apk;
    }

    public long getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(long totalSize) {
        this.totalSize = totalSize;
    }

    public long getDownloadedSize() {
        return downloadedSize;
    }

    public void setDownloadedSize(long downloadedSize) {
        this.downloadedSize = downloadedSize;
    }

    public int getProgress() {
        return progress;
    }

    public void setProgress(int progress) {
        this.progress = progress;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "DownloadMessageEvent{" +
                "control='" + control + '\'' +
                ", message='" + message + '\'' +
                ", isApk=" + isApk +
                ", totalSize=" + totalSize +
                ", downloadedSize=" + downloadedSize +
                ", progress=" + progress +
                ", status=" + status +
                '}';
    }
}
